package edu.dzxx.controller;

import edu.dzxx.pojo.Table;
import edu.dzxx.service.GeologicalService;
import edu.dzxx.pojo.Geological;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

@Controller
@RequestMapping("/geological")
public class GeologicalController {
    @Autowired
    private GeologicalService geologicalService;

    @RequestMapping("/geologicalList")
    @ResponseBody
    public List<Geological> geologicalList(String ID,String tableName,int isDel){
        return geologicalService.getGeologicalList(ID,tableName,isDel);
    }

    @RequestMapping("/delDzxx")
    @ResponseBody
    public Integer delDzxx(String ID,String tableName,int isDel){
        return geologicalService.delDzxx(ID,tableName,isDel);
    }

    @RequestMapping("/updateDzxx")
    @ResponseBody
    public Integer updateDzxx(String tableName,String Label,String Type,String Father,String Reference_ID,String Description,String Location,String Period,String ID){
        return geologicalService.updateDzxx(tableName,Label,Type,Father,Reference_ID,Description,Location,Period,ID);
    }

    @RequestMapping("/getTable")
    @ResponseBody
    public List<Table> getTable(){
        return geologicalService.getTables();
    }
}
